package com.horay.springbootdemo.filter.interceptor.configuration;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * WebMvc配置
 *
 * @author heyingcheng
 * @date 2019/7/22 23:05
 */
@Configuration
public class  WebMvcConfiguration implements WebMvcConfigurer {

    @Autowired
    private DefaultAsyncHandlerInterceptor defaultAsyncHandlerInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        InterceptorRegistration registration = registry.addInterceptor(defaultAsyncHandlerInterceptor);
        registration.addPathPatterns("/**");
    }

}